#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>

int main(int argc, char const *argv[])
{
    pid_t pid = fork();
    if (pid == 0)
    {
        // execl("/usr/bin/ls","ls","-l",NULL);
        // execl("../0901/a.out","./a.out",NULL);
        // execl("./sum", "./sum", "13","15",NULL);
        execlp("./strcmp","./strcmp","hello","world",NULL);
    }

    int stat = 0;
    wait(&stat);
    if(WIFEXITED(stat))
    {
        if(WEXITSTATUS(stat) == 0)
            printf("字符串一样\n");
        else
            printf("字符串不一样\n");
    }
}
